package com.jht.bletool2kotlin

import android.app.Application
import android.content.Context
import org.greenrobot.eventbus.EventBus

class BLEApplication : Application() {

    override fun onCreate() {
        super.onCreate()
        appContext = applicationContext
        EventBus.builder()
            // have a look at the index class to see which methods are picked up
            // if not in the index @Subscribe methods will be looked up at runtime (expensive)
            .addIndex(MyEventBusIndex())
            .installDefaultEventBus()
    }

    companion object {
        lateinit var appContext: Context
    }

}